<%@ page language="java" import="java.util.*" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<!DOCTYPE html>
<html>
 <head>
  <title>教师表</title>
  <t:base type="jquery,easyui,tools,DatePicker"></t:base>
  <script type="text/javascript">
  //编写自定义JS代码
  </script>
 </head>
 <body>
  <t:formvalid formid="formobj" dialog="true" usePlugin="password" layout="table" 
  	action="teacherController.do?doAdd" tiptype="3" beforeSubmit="validateTeacher" >
					<input id="id" name="id" type="hidden" value="${teacherPage.id }">
					<input id="createName" name="createName" type="hidden" value="${teacherPage.createName }">
					<input id="createBy" name="createBy" type="hidden" value="${teacherPage.createBy }">
					<input id="createDate" name="createDate" type="hidden" value="${teacherPage.createDate }">
					<input id="updateName" name="updateName" type="hidden" value="${teacherPage.updateName }">
					<input id="updateBy" name="updateBy" type="hidden" value="${teacherPage.updateBy }">
					<input id="updateDate" name="updateDate" type="hidden" value="${teacherPage.updateDate }">
		<table style="" cellpadding="0" cellspacing="1" class="formtable">
				<tr>
					<td align="right">
						<label class="Validform_label">
							教师编号:
						</label>
					</td>
					<td class="value">
					     	 <input id="teacherNo" name="teacherNo" type="text" style="width: 150px"
					     	  class="inputxt"  datatype="*"  maxlength="20" onkeypress="specialTextValidate()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">教师编号</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							教师名称:
						</label>
					</td>
					<td class="value">
					     	 <input id="teacherName" name="teacherName" type="text"  maxlength="80"
					     	 style="width: 150px" class="inputxt"  datatype="*"  onkeypress="specialTextValidate()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">教师名称</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							生日:
						</label>
					</td>
					<td class="value">
					     	 <input id="birthday" name="birthday" type="text" style="width: 150px" class="inputxt" onClick="WdatePicker()">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">生日</label>
						</td>
				<tr>
					<td align="right">
						<label class="Validform_label">
							性别:
						</label>
					</td>
					<td class="value">
							  <t:dictSelect field="sex" type="radio"
									typeGroupCode="sex" defaultVal="${teacherPage.sex}" hasLabel="false"  title="性别"></t:dictSelect>     
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">性别</label>
						</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							专业:
						</label>
					</td>
					<td class="value"> 
                	     <input id="majorId" name="majorId" type="hidden"  >               
					     <input id="majorName" name="majorName" type="text" style="width: 150px"
					      class="inputxt" readonly="readonly" datatype="*" nullmsg="请选择专业">
					     <t:choose hiddenName="majorId" hiddenid="id" url="dictMajorController.do?goSelect" name="majorList"
                          icon="icon-search" title="选择专业" textname="majorName" isclear="false" isInit="true"></t:choose>
							
						<span class="Validform_checktip"></span>
						<label class="Validform_label" style="display: none;">专业</label>
						
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							系别:
						</label>
					</td>
					<td class="value">
 					     <input id="seriesId" name="seriesId" type="hidden"  >               
					     <input id="seriesName"  type="text" style="width: 150px" class="inputxt" 
					     readonly="readonly" datatype="*" nullmsg="请选择系别">
					     <t:choose hiddenName="seriesId" hiddenid="id" url="dictSeriesController.do?goSelect" name="seriesList"
                          icon="icon-search" title="选择系别" textname="seriesName" isclear="false" isInit="true"></t:choose>
							
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">系别</label>
					</td>
				</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							教研组:
						</label>
					</td>
					<td class="value">
  					     <input id="teachGroupId" name="teachGroupId" type="hidden"  >               
					     <input id=teachGroupName  type="text"  style="width: 150px" class="inputxt" 
					     	readonly="readonly" datatype="*" nullmsg="请选择教研组">
					     <t:choose hiddenName="teachGroupId" hiddenid="id" url="dictTeachGroupController.do?goSelect" name="teachGroupList"
                          icon="icon-search" title="选择教研组" textname="teachGroupName" isclear="false" isInit="true"></t:choose>
							  
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">教研组</label>
					</td>
				<tr>
					<td align="right">
						<label class="Validform_label">
							一卡通:
						</label>
					</td>
					<td class="value">
					     	 <input id="cardNo" name="cardNo" type="text" style="width: 150px" class="inputxt" >
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">一卡通</label>
						</td>
					</tr>
				<tr>
					<td align="right">
						<label class="Validform_label">
							手机号:
						</label>
					</td>
					<td class="value">
					     	 <input onkeyup="this.value=this.value.replace(/\D/g,'')" id="cellphone" name="cellphone" type="text" style="width: 150px" class="inputxt" data-type="M" maxlength="11" onkeyup="this.value=this.value.replace(/\D/g,'')">
							<span class="Validform_checktip"></span>
							<label class="Validform_label" style="display: none;">手机号</label>
						</td>
				
					</tr>
			</table>
		</t:formvalid>
 </body>
 <script type="text/javascript">
 
	$("#birthday").attr("class","Wdate").click(function(){WdatePicker({dateFmt:'yyyy-MM-dd'});});
 
 function validateTeacher(){
		var no = $('#teacherNo').val();
		var result;
		$.ajax({
			url:'teacherController/validateTeacherNo.do?no='+no,
			datatype:'json',
			async:false,
			success:function(data){
				data = $.parseJSON(data);
				if(!data.success){
					tip(data.msg);
					result =  false;
				}else{
					result =  true;
				}
			}
		});
		
		return result;
	}
	
 </script>
  <script src = "webpage/com/mengtian_tech/device_mgr/teacher/teacher.js"></script>		
